package C615;

/**
 * @program: javase
 * @description:
 * @author: luolidong
 * @create: 2021-06-15 15:38
 * @version: 1.0
 */
public class Son extends Father {
      static  int  id;
//    public Son(int id) {
//        super(id);
//    }
    static {
        System.out.println("1");
        System.out.println(id);
    }

    {
        System.out.println("2");
    }

    public Son() {
        System.out.println("3");
    }
    //final可以用做形参，但不能再赋值
    public static void print(final int id){
        System.out.println("静态print"+id);
    }
    public static void main(String[] args) {
//        Father son=new Son();//A 1
//        System.out.println();
//        Son son1 = new Son();//
//        ((Son)null).print();//将Son引用类型强制转换为Son对象
        //相当于
        Son son=null;
        son.print(1);
        Son.print(2);
    }

//        Father son=new Son(123);
//        System.out.println("son.id = " + son.id);
//        Father son1=new Son();
//        System.out.println("son1.id = " + son1.id);
}
//        Father son = new Son();
//        Son son1 = new Son();
//        son.eat();
//        System.out.println(son.id);
//        System.out.println(son1.id);
////        静态变量重写
//        System.out.println(son.name);
//        System.out.println(son1.name);
//    }
